Title: Silver Sheath fix
Author: Assassin
Version: Beta 0.25
Applies to: Secret of Evermore -- US version, English and German European versions,
            French and Spanish European versions
Tested on: US version, briefly on the English and German European, briefly on the Spanish
           and French European

Contents:

        silsheat.ips = the SoE (US) patch
        silsh-e1.ips = the SoE (Europe - English and German) patch
        silsh-e2.ips = the SoE (Europe - French and Spanish) patch
        readme.txt = this file
        battle-power-orig.txt = commented original code (US)
        battle-power-fix.txt  = commented fixed code (US)
        battle-power-orig-euro.txt = commented original code (Europe - English and German)
        battle-power-fix-euro.txt = commented fixed code (Europe - English and German)
        euro-diffs.txt = how the French and Spanish versions differ from the German and
                         English European versions

        (Aside from being shifted back 16 bytes and accessing some different ROM and RAM
         addresses, the basic code involved in the European patches is the same as that of
         the U.S.A. one.)

ROM Addresses: F8664, F8680 through F86B3 (United States)
               F8654, F8670 through F86A3 (Europe)
Functions added: None
Additional Square functions called: None

Urgency: Medium high.  The bug gives swords a slight but noticable damage increase, and
         depending on how you play, you won't permanently have the Silver Sheath until
         either Nobilia or Ivor Tower.  While the challenge at any given point is hardly
         broken, the fact that a common weapon is affected means your extra damage in a
         playthrough will really add up.

============================================================================================

The latest versions of all my patches can be found at either of these sites:

http://www14.brinkster.com/assassin17/
http://assassin17.home.comcast.net/

============================================================================================

TABLE OF CONTENTS

0. Description
1. Cause and More Info
2. What my Patch Does
3. For Testers
4. FAQ
5. Revision History
6. Credits
Unnumbered: Copyright notice

____________________________________________________________________________________________

0. DESCRIPTION
____________________________________________________________________________________________

The Silver Sheath charm is supposed to increase "the strength of the holder's sword-type
weapon", as described by the game.  Specifically, the weapon's battle power is boosted by
25% before being used to calculate the wielder's Attack stat.  However, due to an omitted
check for Silver Sheath, swords ALWAYS get the bonus.

This patch inserts a check for Silver Sheath, so sword-type weapons will only get the 25%
bonus if you possess the charm.

____________________________________________________________________________________________

1. CAUSE AND MORE INFO
____________________________________________________________________________________________

The Attack value (which you'll see in the STAT menu) is derived from character level and
the Battle Power of the weapon.  Here are the basic steps:

1. A value indexed by the character's level is the first thing stored to the "Attack"
   variable.  It appears Sun Stone will pretend your level is 5 higher than normal so as to
   boost this value.

2. The battle power of the weapon is added to Attack.

3. If the weapon type is a sword, 1/4 of its battle power is added again.
   (To reiterate what the game already tells you: Bone Crusher is categorized as a sword.)

Step #3 is located right after #2.  That extra code seems wasteful when Square could have
just directly assigned a higher Battle Power to the swords.. Unless, of course, a Silver
Sheath check was planned in between those two steps or within Step #3. :)

(For those who are wondering what the level-based values in Step #1 are, I'll post a list
on my websites soon.)

In _Final_Fantasy_6_ bugfix Readmes, I'll often devote a section just to speculate how
Square might've caused a certain bug.  No need here:

"From: ItsBillsFault | Posted: 6/21/2004 5:03:40 PM | Message Detail 

[...]

Anyway, here's my guess as to what was in the source code after the sword check:

-------- ; add in silver sheath effect
-------- ; TODO - uncomment this after testing the effect
-------- ;lda SILVER_SHEATH_BYTE
-------- ;bit #SILVER_SHEATH_BIT
-------- ;beq noSheath

Typical programmer brainfart."

ItsBillsFault was the lead programmer of SoE. :)

____________________________________________________________________________________________

2. WHAT MY PATCH DOES
____________________________________________________________________________________________

Inserts a check for Silver Sheath right after the sword check.  This ensures that the 25%
Battle Power bonus is only given to swords when you have Silver Sheath.  As mentioned
before, the boost alters the Attack stat which determines damage and appears in the
STAT menu.  The Battle Power you see in the weapon selection ring indicates the inherent
strength of the weapons, so it's not affected by the sheath.

____________________________________________________________________________________________

3. FOR TESTERS
____________________________________________________________________________________________

Any testing is appreciated.  The patch is fairly simple, but it's possible I missed
something, as this is a product of my foray into the game's code.  I'd especially like some
eyes on the European versions, as I haven't tested anything besides the Bone Crusher and
initial Bazooka on those.

Please provide feedback on the GameFAQs Secret of Evermore message board:  
http://www.gamefaqs.com/console/snes/data/9320.html

Thanks!

____________________________________________________________________________________________

4. FAQ
____________________________________________________________________________________________

Q: So, you discovered that Silver Sheath has no effect!  Fantastic.  However, this does
   nothing to defeat my true nemesis, to quell my premiere obsession: Magic Gourd.
   Does it do anything?!  Surely, you must have found something in your travels.  Surely!

A: The consensus on the GameFAQs _Secret_of_Evermore_ board is that it does nothing, and
   ItsBillsFault recalls that it may have been designed to do nothing as a joke (though it's
   also possible the joke was that it does something really obscure; he can't remember).
   My searches through the code turned up no direct references to Magic Gourd.  However,
   this doesn't *prove* it has no function, as there are also no direct references to
   Oracle Bone, and that charm is indeed functional.  See, the game uses straightforward
   checks for charms' existence (e.g. "LDA CHARM_BYTE" followed by "BIT #CHARM_BIT") when
   it's manipulating stats and such.  However, it utilizes scripts and an interpreter when
   accessing charms during dialogue.  The interpreter is a bit more complicated: charm
   references won't jump out at someone who's skimming the code, and I'm nowhere near
   deciphering (or locating, for that matter :P) the NPC data that determines who will react
   to certain charms.


Q: So what RAM bytes and bits represent each charm, anyway?

A: Here they are:

   7E/2261:

    bit 0 = turn off Dog's gauge display ?
    bit 1 = turn off Boy's gauge display ?
    bit 2 = ?
    bit 3 = ?
    bit 4 = ?
    bit 5 = Armor Polish
    bit 6 = Chocobo Egg
    bit 7 = Insect Incense

   7E/2262:

    bit 0 = Jade Disk
    bit 1 = Jaguar Ring
    bit 2 = Magic Gourd
    bit 3 = Moxa Stick
    bit 4 = Oracle Bone
    bit 5 = Ruby Heart
    bit 6 = Silver Sheath
    bit 7 = Staff of Life

   7E/2263:

    bit 0 = Sun Stone
    bit 1 = Thug's Cloak
    bit 2 = Wizard's Coin
    bit 3 thru 7 = ???

______________________________________________________________________________________________

5. REVISION HISTORY
______________________________________________________________________________________________

Version 0.25 : July 2004 through August 2004

        - July 31 thru August 2: Made European versions of the patch, along with variants of
          the commented asssembly files.


Version 0.20 : May 2004 through July 2004

        - Late May or Early June: Discovered the problem while researching the Magic Gourd.
        - Mid June: Learned the exact cause of the bug.  Had a commented disassembly of the
          original code all but ready.
        - Late June: Vowed to make patch.
        - July: More or less knew how the patch would look near the start of the month, but
          dawdled a lot on testing or writing anything.  I finally made the .IPS patch and
          started on this Readme in late July.  By the end of July, I finished off the Readme
          and commented assembly files.

______________________________________________________________________________________________

6. CREDITS
______________________________________________________________________________________________

        - ItsBillsFault for insight on the location of the bug, how it likely originated,
          coming up with a way for me to assess stack usage, and answering all sorts of
          questions on the game, including how it tests for certain charms.  Kudos also go to
          him and everybody at Squaresoft who MADE the game. :)  (He was lead programmer!  I
          shall leave ascertaining his exact identity as an exercise to the reader...)

        - flamingspinach for making a PAR Codes FAQ for this game.  This nailed down the exact
          bytes for charms possessed; all I had to do was test which bit corresponds to each.

        - Everybody on the GameFAQs _Secret_of_Evermore_ board who posted in my topic on
          Silver Sheath and kept it bumped.  Also, they've accumulated one fine bugs and
          glitches thread (started by androl eons ago; he still posts there).  Finally, the
          board users are to be commended for their constant bumping (the board's not terribly
          busy, so bumping turns into a full-time job there). :)

______________________________________________________________________________________________

Secret of Evermore copyright 1995 Squaresoft.
This readme and all other files in the archive (as listed above)
  copyright 2004 Assassin.
All rights reserved.
